package day7;

/**
 * @author oldliu
 * @since 1.0
 */
public class Student {
    String name;

    int age;
    int math;
    int chinese;
    int english;

    public Student(){

    }
    public Student(String name,int a,int c,int m,int eng){
        this.name=name;//就近原则
        age=a;
        chinese=c;
        math=m;
        english=eng;
    }
    //只初始化   姓名和年龄
    public Student(String name,int age){
        this.name=name;
        this.age=age;
    }
    //只初始化姓名和语文成绩
    public Student(int ch,String name){
        //this.name=name;
        //this.chinese=ch;
        //必须是第一行，调用其他构造方法
        this(name,0,ch,0,0);
        //调用实例方法
        this.show();
    }
    public void show(){
        System.out.println("这个学生叫"+name+",今年"+age+"岁了");
        System.out.println("语文 "+chinese+",数学："+math+",杨文："+english);
    }
}
